/*
 * ILexer.h
 *
 *  Created on: 2011-5-27
 *      Author: yangentao@gmail.com
 */

#ifndef ILEXER_H_
#define ILEXER_H_

class IDocument {
public:
	virtual int  Version() const = 0;
	virtual void  SetErrorStatus(int status) = 0;
	virtual int  Length() const = 0;
	virtual void  GetCharRange(char *buffer, int position, int lengthRetrieve) const = 0;
	virtual char  StyleAt(int position) const = 0;
	virtual int  LineFromPosition(int position) const = 0;
	virtual int  LineStart(int line) const = 0;
	virtual int  GetLevel(int line) const = 0;
	virtual int  SetLevel(int line, int level) = 0;
	virtual int  GetLineState(int line) const = 0;
	virtual int  SetLineState(int line, int state) = 0;
	virtual void  StartStyling(int position, char mask) = 0;
	virtual bool  SetStyleFor(int length, char style) = 0;
	virtual bool  SetStyles(int length, const char *styles) = 0;
	virtual void  DecorationSetCurrentIndicator(int indicator) = 0;
	virtual void  DecorationFillRange(int position, int value, int fillLength) = 0;
	virtual void  ChangeLexerState(int start, int end) = 0;
	virtual int  CodePage() const = 0;
	virtual bool  IsDBCSLeadByte(char ch) const = 0;
	virtual const char *  BufferPointer() = 0;
	virtual int  GetLineIndentation(int line) = 0;
};

enum { lvOriginal=0 };

class ILexer {
public:
	virtual int  Version() const = 0;
	virtual void  Release() = 0;
	virtual const char *  PropertyNames() = 0;
	virtual int  PropertyType(const char *name) = 0;
	virtual const char *  DescribeProperty(const char *name) = 0;
	virtual int  PropertySet(const char *key, const char *val) = 0;
	virtual const char *  DescribeWordListSets() = 0;
	virtual int  WordListSet(int n, const char *wl) = 0;
	virtual void  Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0;
	virtual void  Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0;
	virtual void *  PrivateCall(int operation, void *pointer) = 0;
};


#endif /* ILEXER_H_ */
